﻿using Abp.AutoMapper;
using Abp.Web.Mvc.Authorization;
using FutureApp.Authorization;
using FutureApp.Shop;
using FutureApp.Web.Models.Shop;
using System;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace FutureApp.Web.Controllers
{
    [AbpMvcAuthorize(PermissionNames.Pages_Goods)]
    public class GoodsController : FutureAppControllerBase
    {
        public IGoodsAppService GoodsAppService { get; set; }
        public IGoodsBrandAppService GoodsBrandAppService { get; set; }
        public IGoodsMouldAppService GoodsMouldAppService { get; set; }
        public IGoodsCategoryAppService GoodsCategoryAppService { get; set; }


        public ActionResult List()
        {
            return this.View();
        }

        public ActionResult Add()
        {
            return this.View();
        }

        public async Task<ActionResult> Edit(Guid id)
        {
            var model = new GoodsViewModel
            {
                CurrentGoods = await this.GoodsAppService.GetGoodsById(id)
            };
            return this.View(model);
        }
    }
}
